package com.zhou.cloud.service.impl;

import com.zhou.cloud.dao.entity.Dept;
import com.zhou.cloud.dao.mapper.DeptMapper;
import com.zhou.cloud.service.IDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhouyongjun
 * @Description:
 * @date 2021/4/6 16:43
 */
@Service
public class DeptServiceImpl implements IDeptService {
    @Autowired
    DeptMapper deptMapper;

    @Override
    public Dept get(Long id) {
        return deptMapper.selectByPrimaryKey(id);
    }

    @Override
    public Boolean add(Dept dept) {
        return deptMapper.insert(dept) > 0;
    }

    @Override
    public List<Dept> getAll() {
        return deptMapper.selectAll();
    }
}
